#ifndef COMMON_H
#define COMMON_H

#include "types.h"
#include "compiler.h"

#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
#define ROUND_UP(n, d) (DIV_ROUND_UP(n, d) * (d))

#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))

#endif